/**
 * 角色管理APi
 */
import request from '/@/utils/request';

export function readAllRole(params?: any) {
  return request({
    url: 'mgr/roles',
    method: 'get',
    params,
  });
}

export function createRole(data: any) {
  return request({
    url: 'roles',
    method: 'post',
    data,
  });
}

export function updateRole(id: string, data: any) {
  return request({
    url: `roles/${id}`,
    method: 'patch',
    data,
  });
}

export function deleteRole(id: string) {
  return request({
    url: `roles/${id}`,
    method: 'delete',
  });
}
